package com.syl.qianyin.spider.init;

import com.syl.qianyin.spider.service.VerifyIpPoolService;
import com.syl.qianyin.spider.service.XiCiIPSpiderService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 初始化ip代理池
 * 默认使用西刺ip代理
 * @author syl
 * @create 2019-05-12 8:51
 **/
@Component
public class InitIpPool implements InitializingBean{

    @Autowired
    private XiCiIPSpiderService ipSpiderService;
    @Autowired
    private VerifyIpPoolService verifyIpPoolService;

    @Override
    public void afterPropertiesSet() throws Exception {
        ipSpiderService.start();// 拉取ip 代理池
//        verifyIpPoolService.start(); // 检验ip 代理
    }

}
